#define _CRT_SECURE_NO_WARNINGS 
#include <stdio.h>

int main()
{
	char a;
	int i = 0;
	int number = 0;
	int space = 0;
	int letters = 0;
	int other = 0;

	while ((a = getchar()) && a != '\n')
	{
		if (a >= '0' && a <= '9')
		{
			number++;
		}
		else if (a == ' ')
		{
			space++;
		}
		else if ((a >= 'a' && a <= 'z') || (a >= 'A' && a <= 'Z'))
		{
			letters++;
		}
		else { other++; }
	}
	printf("%d %d %d %d", number, space, letters, other);

	return 0;
}